package com.hxkj.controller.userCenter;

import com.hxkj.domain.po.SysNavigates;
import com.hxkj.service.userCenter.SysNavigatesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.concurrent.Callable;

@RestController
@RequestMapping(value = "/navigates")
public class SysNavigatesController {

    @Autowired
    private SysNavigatesService sysNavigatesService;

    @RequestMapping(value = "/save")
    public void save(@ModelAttribute SysNavigates sysNavigates) throws Exception{
        sysNavigatesService.save(sysNavigates);
    }

    @RequestMapping(value = "/select")
    public Callable<List<SysNavigates>> select() throws Exception{
        return () -> sysNavigatesService.select();
    }

    @RequestMapping(value = "/delete")
    public void delete(@ModelAttribute SysNavigates sysNavigates) throws Exception{
        sysNavigatesService.delete(sysNavigates);
    }

    @RequestMapping(value = "/modify")
    public void modify(@ModelAttribute SysNavigates sysNavigates) throws Exception{
        sysNavigatesService.modify(sysNavigates);
    }

    @RequestMapping(value = "/move")
    public void move(String navIds) throws Exception{
        sysNavigatesService.move(navIds);
    }
}
